import request from '@/utils/Request'

/**
 * 加载销售数据
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const loadOrderSaleDataApi = (data) => {
    return request.get('/orders/countSales', {
        params: { days: data.days } // 将 days 放入一个对象中
    });
};
/**
 * 加载销售数据中的商品数量
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const loadPipeChartDataApi = (data) => {
    return request.get('/orders/countSalesByCategory',{
        params:data
    })
};
/**
 * 加载商品数据用于饼状图
 * @param data
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const loadProductPipeChartDataApi = (data) => {
    return request.get('/sellerProduct/selectAll',{
        params : data
    })
};

export const loadProductBarChartDataApi = () => {
    return request.get('/sellerProduct/countCategory')
};